﻿Imports System.ComponentModel
Imports Aricie.DNN.UI.WebControls.EditControls
Imports Microsoft.ApplicationServer.Caching
Imports DotNetNuke.UI.WebControls
Imports Aricie.DNN.UI.Attributes

Namespace Aricie.DNN.Caching.Client.Velocity
    <Serializable()> _
    Public Class AppFabricClusterSettings
        Inherits VelocityClusterSettings


        Private _MaxConnectionsToServer As Integer = 1
        Private _ChannelOpenTimeout As New STimeSpan(TimeSpan.FromSeconds(3))
        Private _SecurityProperties As New DataCacheSecurity(Microsoft.ApplicationServer.Caching.DataCacheSecurityMode.None, Microsoft.ApplicationServer.Caching.DataCacheProtectionLevel.None)

        <ExtendedCategory("AppFabricSettings")> _
        Public Property IsCompressionEnabled As Boolean

        <ExtendedCategory("AppFabricSettings")> _
        Public Property MaxConnectionsToServer() As Integer
            Get
                Return _MaxConnectionsToServer
            End Get
            Set(ByVal value As Integer)
                _MaxConnectionsToServer = value
            End Set
        End Property

        <ExtendedCategory("AppFabricSettings")> _
        <Editor(GetType(PropertyEditorEditControl), GetType(EditControl))> _
            <LabelMode(LabelMode.Top)> _
        Public Property ChannelOpenTimeout() As STimeSpan
            Get
                Return _ChannelOpenTimeout
            End Get
            Set(ByVal value As STimeSpan)
                _ChannelOpenTimeout = value
            End Set
        End Property

        <ExtendedCategory("AppFabricSettings")> _
        Public Property DataCacheServiceAccountType As DataCacheServiceAccountType

        <ExtendedCategory("AppFabricSettings")> _
        <Editor(GetType(PropertyEditorEditControl), GetType(EditControl))> _
            <LabelMode(LabelMode.Top)> _
        Public Property SecurityProperties() As DataCacheSecurity
            Get
                Return _SecurityProperties
            End Get
            Set(ByVal value As DataCacheSecurity)
                _SecurityProperties = value
            End Set
        End Property


    End Class
End Namespace